package com.hmdp.mapper;

import com.hmdp.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 虎哥
 * @since 2021-12-22
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    /**
     * 校验用户是否存在
     * @param phone
     * @return
     */
    User selectUser(String phone);

    /**
     * 向数据库中添加新用户
     * @param user
     */
    void addNewUser(User user);

    /**
     * 查看博主主页
     * @param id
     * @return
     */
    User getUser(Long id);
}
